Skip to content

Conversation

@daniel-graham-amplitude
Copy link
Collaborator

@daniel-graham-amplitude daniel-graham-amplitude commented Jan 3, 2026

Summary

Cancel a rage click if there is a text highlight event that happens after a click.

If a user clicks 1 or more times, and then text is highlighted, that suggests that the user's clicks caused the text to be highlighted

Here's a demonstration to show if you highlight text in an input, the first 3 clicks cause the text to be highlighted, which cancels out the rage click. You thus need at least 7 clicks for it to be a rage click (4 clicks after the text is done being highlighted).

Screen.Recording.2026-01-02.at.5.41.11.PM.mov

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: No

Note

Prevents false rage clicks by introducing text-selection awareness and resetting the rage-click window when selection occurs.

  • Adds selectionObservable (listening to document.selectionchange) to detect non-collapsed selections in inputs/textareas and other elements
  • Updates trackRageClicks to subscribe to selectionObservable and resetClickWindow, returning a composite subscription for proper teardown
  • Extends AllWindowObservables and ObservablesEnum to include selectionObservable
  • Adds/updates tests for selection observable behavior and its interaction with rage-click detection

Written by Cursor Bugbot for commit b4702ab. This will update automatically on new commits. Configure here.

 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
This reverts commit db34376.
…cript into AMP-146045-rage-click-fix-mobile-scroll-false-positive
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
 - @amplitude/[email protected]
@daniel-graham-amplitude daniel-graham-amplitude marked this pull request as draft January 3, 2026 00:27
@daniel-graham-amplitude daniel-graham-amplitude changed the title Amp 146044 fix highlightable text rage clicks fix(plugin-autocapture-browser): do not trigger rage click when text being highlighted Jan 3, 2026
@daniel-graham-amplitude daniel-graham-amplitude force-pushed the AMP-146045-rage-click-fix-mobile-scroll-false-positive branch from 3696ef2 to 2f9f9a5 Compare January 5, 2026 17:34
… of github.com:amplitude/Amplitude-TypeScript into AMP-146044-fix-highlightable-text-rage-clicks
… AMP-146045-rage-click-fix-mobile-scroll-false-positive
… of github.com:amplitude/Amplitude-TypeScript into AMP-146044-fix-highlightable-text-rage-clicks
Base automatically changed from AMP-146045-rage-click-fix-mobile-scroll-false-positive to main January 5, 2026 22:37
@daniel-graham-amplitude daniel-graham-amplitude marked this pull request as ready for review January 5, 2026 22:37
… AMP-146044-fix-highlightable-text-rage-clicks
@promptless
Copy link

promptless bot commented Jan 5, 2026

📝 Documentation updates detected!

New suggestion: Document rage click text selection behavior

@daniel-graham-amplitude daniel-graham-amplitude merged commit 7564033 into main Jan 8, 2026
11 checks passed
@daniel-graham-amplitude daniel-graham-amplitude deleted the AMP-146044-fix-highlightable-text-rage-clicks branch January 8, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants